// Singleton pattern.

#include <iostream>
#include <cstring>
using namespace std;

class Singleton {
	public:
		static Singleton& getInstance( ) {
			return s_instance;
		}
	private:
		Singleton( ) {}
		Singleton( const Singleton& that ) {}
		static Singleton s_instance;
};

Singleton Singleton::s_instance;

// designer
// ------------------------------------------------------------------
// user

int main( void ) { 
	Singleton& s1 = Singleton::getInstance( );
	Singleton& s2 = Singleton::getInstance( );
	Singleton& s3 = Singleton::getInstance( );
	cout << "&s1 : " << &s1 << endl;
	cout << "&s2 : " << &s2 << endl;
	cout << "&s3 : " << &s3 << endl;

	return 0;
}

